<?php
    $this->title = 'Index';
    $this->headTitle($this->title);
    $this->exturl = '?';
    if ($this->page != 1) $this->exturl .= 'page=' . $this->page;
    if ($this->sort != '') $this->eexturl .= '&sort=' . $this->sort;
    
?>
<div id="contianer">
  
  	<div id="con">
  		
  	</div>

        
	<ul id="pagination-flickr">
		<?php if ($this->page <= MAXITEM):?>
		<li class="previous-off">TrÆ°á»›c</li>
		<?php else :?>
		<li class="previous"><a
			href="?page=<?php echo $this->begin - 1; if ($this->sort != '') echo '&sort=' . $this->sort;?>">TrÃ†Â°Ã¡Â»â€ºc</a>
		</li>
		<?php endif;



		for($i = $this->begin; $i <= $this->end; $i++) :
		if ($i == $this->page) :?>
		<li class="active"><?php echo ( $i ) ;?></li>
		<?php else : ?>

		<li><a
			href="?page=<?php echo $i ; if ($this->sort != '') echo '&sort=' . $this->sort;?>"><?php echo $i ;?>
		</a></li>
		<?php endif;
		endfor;

		if ($this->end % MAXITEM == 0 && $this->end * MAXITEM != $this->total) :
		?>

		<li class="next"><a title="Trang káº¿ tiáº¿p"
			href="?page=<?php echo $this->end + 1; if ($this->sort != '') echo '&sort=' . $this->sort;?>">Tiáº¿p</a>
		</li>
		<?php else :?>

		<li class="next-off">Tiáº¿p</li>
		<?php endif;?>
	</ul>
	<br>     
   

<form method="post" action="<?php echo $this->exturl?>" id='frm-filter'>
	<div class="form-item">
		<label for="num">Sá»‘ lÆ°á»£ng gá»�i lá»›n hÆ¡n:</label> 
		<input id="num" name='num' type="text" class="form-text" <?php if (isset($_COOKIE['mincount'] )) echo 'value="' . $_COOKIE["mincount"] . '"'?> />
	</div>
	<input type="submit" class="white button" value="OK"/>
</form>


<div id="time-filter">
	<fieldset>
		<legend>Giá»›i háº¡n thá»�i gian láº¥y dá»¯ liá»‡u</legend>
		<div>
			<form method="post" action="<?php echo $this->exturl?>">
				<label for="from">Tá»«</label>
				<input type="text" name="from" id="from" <?php echo isset($this->fromDate) ? 'value="' . $this->fromDate . '"' : '' ?> />
				
				<label for="to">Ä�áº¿n</label>
				<input type="text" name="to" id="to"  <?php echo  isset($this->toDate) ? 'value="' . $this->toDate . '"' : '' ?> />
				
				<input class="white button" type="submit"  />
			</form>
		</div>
	</fieldset>
</div>

<script type="text/javascript">
		$(function() {
			$( "#from" ).datepicker({ dateFormat : "yy-mm-dd"
				 <?php  echo isset($_COOKIE['fromDate'] ) ? ', defaultDate : "' . $_COOKIE['fromDate'] .'"' : ''?> });;
			$( "#to" ).datepicker({ dateFormat : "yy-mm-dd"
				 <?php  echo isset($_COOKIE['toDate'] ) ? ', defaultDate : "' . $_COOKIE['toDate'] .'"' : ''?> });;
		});
</script>

</div>